/**
 * 
 */
package easyzhou.com.utils;

import java.io.File;

import easyzhou.com.bean.Result;
import easyzhou.com.utils.svn.SVNLogHandler;

/**
 *
 *
 * @author zhoucong
 * @date 2016年3月28日 下午8:07:12
 */
public class ResultFormater {
	public static String toString(Result result) {
		StringBuilder sb = new StringBuilder();
		sb.append("############################ ... \n");
		sb.append("fail ... \n");
		sb.append("############################ ... \n");
		for (File[] file : result.getErrList()) {
			sb.append("from : " + file[0].getAbsolutePath());
			sb.append(" \n ");
			sb.append("to : " + file[1].getAbsolutePath());
			sb.append(" ---------------------------\n ");
			sb.append(" \n ");
		}
		sb.append("############################ ... \n");
		sb.append("delete  ... \n");
		sb.append("############################ ... \n");
		for (String file : result.getDeleteFileList()) {
			sb.append("rm -Rf " + SVNLogHandler.formatOutputFileName(file));
			sb.append(" ---------------------------\n ");
			sb.append(" \n ");
		}
		sb.append("############################ ... \n");
		sb.append("successfyllyList ... \n");
		sb.append("############################ ... \n");
		for (File[] file : result.getSuccessfyllyList()) {
			sb.append("from : " + file[0].getAbsolutePath());
			sb.append(" \n ");
			sb.append("to : " + file[1].getAbsolutePath());
			sb.append(" ---------------------------\n ");
			sb.append(" \n ");
		}
		return sb.toString();
	}
}
